import java.time.LocalDate;
import java.time.DayOfWeek;
import java.time.temporal.TemporalAdjusters;

public class SundaysOfYear {
    public static void main(String[] args) {
        // 获取当前年份
        LocalDate today = LocalDate.now();
        int currentYear = today.getYear();

        // 获取今年的第一个星期天的日期
        LocalDate firstSunday = today.with(TemporalAdjusters.firstInMonth(DayOfWeek.SUNDAY));
        if (firstSunday.getYear() != currentYear) {
            firstSunday = firstSunday.plusWeeks(1);
        }

        // 输出今年所有星期天的日期
        System.out.println("今年（" + currentYear + "年）的所有星期天日期：");
        while (firstSunday.getYear() == currentYear) {
            System.out.println(firstSunday);
            // 下一个星期天
            firstSunday = firstSunday.plusWeeks(1);
        }
    }
}